package split

import (
	"strings"
)

// Split 用法Split("a,b" ,",") => []string{a,b}
func Split(inputString, spe string) (result []string) {
	idx := strings.Index(inputString, spe)
	for idx > -1 {
		result = append(result, inputString[:idx])
		inputString = inputString[idx+len(spe):]
		idx = strings.Index(inputString, spe)
	}
	result = append(result, inputString[:])
	return
}
